package com.sobey.web.function.controller.produceplan;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

import com.sobey.web.function.model.oracle.Demo;

/**
 * 
 * ProducePlan 节目代码管理模块
 * 
 * @author luozhiwei
 * @since 2016-06-17
 */
@Controller
@RequestMapping(("/produceplan"))
public class ProducePlanController {
	
	private static final Logger LOGGER = Logger.getLogger(ProducePlanController.class);
	
	@RequestMapping(value = "/list.json", produces = { MediaType.APPLICATION_JSON_VALUE + ";charset=UTF-8"})
	@ResponseBody
	@ResponseStatus(HttpStatus.OK)
	public List getlist(){
		List list = new ArrayList();
		
		for (int i = 0; i < 3; i++) {
			Demo d = new Demo();
			d.setId(new Long(i+1));
			d.setAge(10 + i);
			d.setModifyDate(new Date());
			d.setName("Demo" + (i+1));
			list.add(d);
		}
		
		return list;
	}
}
